package com.oasistudio.ads.expert;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;

public class HelpActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//System.out.println("BeginIWords.onCreate();");
		setContentView(R.layout.user_guide);
		WebView webView = (WebView)this.findViewById(R.id.user_guide_webview);
		webView.loadUrl("file:///android_asset/help.html");
	}

	public void close(View view) {
		this.finish();
	}

	public void neverShowAgain(View view) {
		saveSettings(true);
		close(view);
	}

	private void saveSettings(boolean neverShowAgain) {
		SharedPreferences settings = this.getSharedPreferences(HelpActivity.class.getName(), MODE_PRIVATE);
		SharedPreferences.Editor editor = settings.edit();
		editor.putBoolean("neverShowAgain", neverShowAgain);
		editor.commit();
	}
	
    public void onPause(){
    	super.onPause();
    	//System.out.println("BeginIWords.onPause() this = "+this);
    	this.finish();
    }
	protected void onResume() {
		// System.out.println("IWords.onResume()");
		super.onResume();
	}
}
